/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package generator.statements;

import java.util.Date;

/**
 * @author Mateusz Pytel 
 * @email dj-necro@wp.pl
 * @since 
 * @version 
 */
public class Invoice extends Statement {
    
    private int invoiceID;
    
    private Reservation reservation;
    
    private Date date;
    
    private float charge;
    
    private int cancelled;
    
    private PaymentForm paymentForm;
    
    private Date paymentDate;



    public Invoice(int invoiceID, Reservation reservation, Date date, float charge, int cancelled, PaymentForm paymentForm, Date paymentDate)
    {
        this.invoiceID = invoiceID;
        this.reservation = reservation;
        this.date = date;
        this.charge = charge;
        this.cancelled = cancelled;
        this.paymentForm = paymentForm;
        this.paymentDate = paymentDate;
    }    
    
    @Override
    public String getFieldsNameSet() {
         return "[invoice_id], [reservation_id], [date], [charge], [cancelled], [payment_form_id], " +
                 "[payment_date]";
    }

    @Override
    public Object[] getFieldsValueCollection() {

      return new Object[] {invoiceID, reservation.getId(), date.toString(), Float.toString(charge), Integer.toString(cancelled),
              paymentForm.getId(),paymentDate.toString() };
    }

    @Override
    public int getId() {
        return invoiceID;
    }
    
     @Override
    public String getTableName()
    {
        return "invoice";
    }    
}



